package com.team12.hotel404.service.serviceImpl;

import com.team12.hotel404.domain.City;
import com.team12.hotel404.domain.CityExample;
import com.team12.hotel404.mapper.CityMapper;
import com.team12.hotel404.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityMapper cityMapper;
    @Override
    public List<City> listAllCiyt() {
        return cityMapper.selectByExample(new CityExample());
    }

    @Override
    public void updateCityInfo(City city) {
        cityMapper.updateByPrimaryKeySelective(city);
    }

    @Override
    public City findById(Integer id) {
        return cityMapper.selectByPrimaryKey(id);
    }
}
